package com.itheima.mapper;

import com.itheima.pojo.Emp;
import com.itheima.pojo.JobOption;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface EmpMapper {


    List<Emp> findAll(@Param("name") String name, @Param("gender") Integer gender, @Param("begin") LocalDate begin, @Param("end") LocalDate end);

    @Insert("insert into emp(username,password,name,gender,phone,job,salary,image,entry_date,dept_id,create_time,update_time) values"+
            "(#{username},#{password},#{name},#{gender},#{phone},#{job},#{salary},#{image},#{entryDate},#{deptId},#{createTime},#{updateTime})")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
    void add(Emp emp);

    void delete(@Param("ids")Integer[] ids);

    Emp getById(Integer id);

    void update(Emp emp);

    @Select("select * from emp")
    List<Emp> list();

    List<Map<String, Object>> jobData();

    List<Map<String, Object>> empGenderData();

    List<Map<String, Object>> studentDegreeData();

    List<Map<String, Object>> studentCountData();
}
